﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyFriends.aspx.cs" Inherits="TripLOA.GUI.secure.MyFriends"
    MasterPageFile="~/GUIMaster.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="ContentHomePage">
    <h1>
        <asp:Label ID="title_friends" Text="Amici" runat="server" />
    </h1>
    
    <div id="MyFriendsContent">
    
   
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        
        <div id="add_friends">
            <asp:Label ID="Label2" runat="server" meta:resourcekey="lbl_add" CssClass="lbl_strong"></asp:Label>
            <asp:TextBox ID="TextBox1" runat="server" CssClass="txtBox_generics" ></asp:TextBox>
            <asp:Button ID="Button1" runat="server" CssClass="button_generics" OnClick="Button1_Click" meta:resourcekey="bt_add" />
            &nbsp;&nbsp; <br />
            <div class="validator">
                <asp:Label ID="Label3" runat="server" Font-Bold="True" Font-Size="Small" 
                    ForeColor="#C9F912" Visible="False"></asp:Label>
            </div>
        </div>
        <div id="header_content_friends"></div>
        <div id="line_content_friends">
            <asp:Label ID="lbl_friends" CssClass="label_title" meta:resourcekey="lbl_friends" runat="server"></asp:Label><br />
            <asp:Label ID="lbl_msg_noFriends" CssClass="lbl_strong" meta:resourcekey="lbl_no_friends" runat="server" Visible="false"></asp:Label>
            
                <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                    <ProgressTemplate>
                    <div id="loader_friends">
                        <img alt="Loading please wait" src="../master/resourcesNew/img/loader.gif" />
                            <asp:Label ID="loader_message" runat="server" CssClass="lbl_strong" meta:resourcekey="lbl_message_loader"></asp:Label>
                            </div>
                        </ProgressTemplate>
                    
                </asp:UpdateProgress>
            
            <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="TripLOA.GUI.DataSourceRepository"
                Select="new (Id, Username)" TableName="GetBuddyList">
            </asp:LinqDataSource>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" GridLines="None" BorderStyle="None" AllowSorting="True"
                AutoGenerateColumns="False" DataSourceID="LinqDataSource1" 
                DataKeyNames="Username">
                <Columns>
                    <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server" />
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True"
                        SortExpression="Id" Visible="False" />
                    <%--<asp:BoundField DataField="Nickname" HeaderText="Nickname" ReadOnly="True" 
                        SortExpression="Nickname" />--%>
                          <asp:TemplateField>
                        <ItemTemplate>
                        <asp:HyperLink ID="hyperMyFriend" runat="server" 
                    NavigateUrl='<%# "userProfile.aspx?Nick=" +  Eval("Username") %>'><%# Eval("Username")%></asp:HyperLink>
                    </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <br />
            
            <asp:Button ID="Button2" runat="server" onclick="Button2_Click"  CssClass="button_generics" meta:resourcekey="bt_Delete" CausesValidation="False" />
            <asp:Button ID="Button3" runat="server" CssClass="button_generics" 
                meta:resourcekey="bt_Ban" CausesValidation="False" onclick="Button3_Click" 
                Visible="False" />
            
                </div>
                
            
           <div id="footer_content_friends" />
           
            <div>
             
                <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                    ContextTypeName="TripLOA.GUI.DataSourceRepository" Select="new (Id, Username)" 
                    TableName="GetBannedList">
                </asp:LinqDataSource>
                <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                    DataSourceID="LinqDataSource2" DataKeyNames="Username" Visible="False" >
                     <Columns>
                    <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelectBanned" runat="server" />
                    </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True"
                        SortExpression="Id" Visible="False" />
                    <%--<asp:BoundField DataField="Nickname" HeaderText="Nickname" ReadOnly="True" 
                        SortExpression="Nickname" />--%>
                          <asp:TemplateField>
                        <ItemTemplate>
                        <asp:HyperLink ID="hyperMyBanned" runat="server" 
                    NavigateUrl='<%# "userProfile.aspx?Nick=" +  Eval("Username") %>'><%# Eval("Username")%></asp:HyperLink>
                    </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                </asp:GridView>
             
             </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </div>
</asp:Content>
